package com.agh.portal.web;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;



@Controller
@RequestMapping("/testPage" )
public class TestController {
	
	@RequestMapping(produces = "text/html")
	public String showTestPage(){
		return "testPage";
	}
	
	@RequestMapping("/subPage")
	public String subPage(){
		return "subPage";
	}
	
	@RequestMapping(value = "testPost", method = RequestMethod.POST)
	public @ResponseBody Map<String, Object> post(@RequestBody final String name) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("lelel", "topkek");
		System.out.println(name);

		return map;
	}

}
